import java.util.Scanner;

public class demo03 {
    //四平方和
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int num = 0;
        while (num * num <= n) {
            num++;
        }
        for (int i = 0; i <= num; i++) {
            for (int j = i; j <= num; j++) {
                for (int k = j; k <= num; k++) {
                    for (int l = k; l <= num; l++) {
                        if(l*l+k*k+j*j+i*i==n){
                            System.out.println(i+" "+j+" "+k+" "+l);
                            return;
                        }
                    }
                }
            }
        }
    }
}
